<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box2 {
            font-size: 100px;
            color: transparent;
     
            background: linear-gradient(to right,pink,yellow);
            /* 从头部开始的线性渐变，从红色开始，转为黄色，再到蓝色: */
            /* background-image: linear-gradient(red, yellow, blue); */

            background-clip: text;
            -webkit-background-clip: text;
        }
    </style>
</head>
<body>

    <div class="box2" >我是渐变色</div>

    
</body>
</html>